package Fail3_17;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 * 往文件里写入
 */
public class FileDemo6 {
    public static void main(String[] args) {
        try (OutputStream outputStream=new FileOutputStream("./hello.txt")){
           try (PrintWriter writer=new PrintWriter(outputStream)){
               writer.println("你好");
           }
//            String s="hello world";
//            outputStream.write(s.getBytes());
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
